<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<head th:include="/base/common_css('test')">
<body>
<div th:include="/base/common_banner"></div>
<!-- Main content starts -->

<div class="content">
    <!-- Sidebar -->
    <div th:include="/base/common_menu"></div>
    <!-- Sidebar
    <div class="sidebar">
        <div class="sidebar-dropdown"><a href="#">Navigation</a></div>

    </div>-->
    <!-- Matter -->
    <div class="mainbar">
        <!-- Page heading -->
        <div th:include="/base/common_pageHeader"></div>

        <div class="matter">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">

                        <div class="widget wgreen">

                            <div class="widget-head">
                                <div class="pull-left">修改排行</div>
                                <div class="widget-icons pull-right">
                                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a>
                                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="widget-content">
                                <div class="padd">

                                    <!-- Form starts.  -->
                                    <form id="formid" class="form-horizontal" action="#" method="post"
                                          style="align-content: center">
                                        <input type="hidden" id="albId" th:value="${rankingVO.albId}">
                                        <input type="hidden" id="type" th:value="${rankingVO.type}">

                                        <div class="form-group">
                                            <label for="albName" class="col-lg-4 control-label">专辑名</label>
                                            <input style="width:200px" type="text" name="albName"
                                                   th:value="${rankingVO.albName}" readonly="readonly"
                                                   class="form-control"
                                                   id="albName" placeholder="专辑名">
                                        </div>
                                        <div class="form-group">
                                            <label for="num" class="col-lg-4 control-label">数量</label>
                                            <input style="width:200px" type="text" name="num"
                                                   class="form-control" th:value="${rankingVO.num}"
                                                   id="num" placeholder="数量">
                                        </div>

                                    </form>
                                    <div class="modal-footer">
                                        <button type="button" id="saveUpdate"
                                                class="btn btn-success">保存
                                        </button>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Mainbar ends -->
<div class="clearfix"></div>

</div>
<!-- Content ends -->

<div th:include="/base/common_footer"></div>
<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>
<!--js????-->
<div th:include="/base/common_js"></div>
<script type="text/javascript">

    $("#cancle").click(function () {
        location.href="/view/top?type1=1&type2=2&type3=3";

    })

    $("#saveUpdate").click(function () {
//        alert(document.getElementById("albId").value);

        $.ajax({
            type: "get",
            url: "/view/updateStatistical",
            data: {
                albId: $('#albId').val(),
                type: $('#type').val(),
                num: $('#num').val(),
            },
            dataType: "json",
            success: function (data) {
                if (data.data) {
                    window.location.href = "/view/top?type1=1&type2=2&type3=3";
                }
            },
        });
    });


</script>
</body>
</html>